﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    partial class Orchard_Comments_CommentPartRecord : RaisingStudio.Data.Common.IDataObjectProxy
    {
        #region IDataObjectProxy Members

        public Type GetPropertyType(string name)
        {
            switch (name)
            {                
                case "Id":
                   {
                       return typeof(int);
                   }
                case "Author":
                   {
                       return typeof(string);
                   }
                case "SiteName":
                   {
                       return typeof(string);
                   }
                case "UserName":
                   {
                       return typeof(string);
                   }
                case "Email":
                   {
                       return typeof(string);
                   }
                case "Status":
                   {
                       return typeof(string);
                   }
                case "CommentDateUtc":
                   {
                       return typeof(DateTime?);
                   }
                case "CommentText":
                   {
                       return typeof(string);
                   }
                case "CommentedOn":
                   {
                       return typeof(int?);
                   }
                case "CommentedOnContainer":
                   {
                       return typeof(int?);
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectAccessor Members

        public object GetValue(object instance, string name)
        {
            Orchard_Comments_CommentPartRecord _instance = instance as Orchard_Comments_CommentPartRecord;
            switch (name)
            {                
                case "Id":
                   {
                       return _instance.Id;
                   }
                case "Author":
                   {
                       return _instance.Author;
                   }
                case "SiteName":
                   {
                       return _instance.SiteName;
                   }
                case "UserName":
                   {
                       return _instance.UserName;
                   }
                case "Email":
                   {
                       return _instance.Email;
                   }
                case "Status":
                   {
                       return _instance.Status;
                   }
                case "CommentDateUtc":
                   {
                       return _instance.CommentDateUtc;
                   }
                case "CommentText":
                   {
                       return _instance.CommentText;
                   }
                case "CommentedOn":
                   {
                       return _instance.CommentedOn;
                   }
                case "CommentedOnContainer":
                   {
                       return _instance.CommentedOnContainer;
                   }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        public void SetValue(object instance, string name, object value)
        {
            Orchard_Comments_CommentPartRecord _instance = instance as Orchard_Comments_CommentPartRecord;
            switch (name)
            {                
                case "Id":
                    {
                        _instance.Id = (int)value;
                        return;
                    }
                case "Author":
                    {
                        _instance.Author = (string)value;
                        return;
                    }
                case "SiteName":
                    {
                        _instance.SiteName = (string)value;
                        return;
                    }
                case "UserName":
                    {
                        _instance.UserName = (string)value;
                        return;
                    }
                case "Email":
                    {
                        _instance.Email = (string)value;
                        return;
                    }
                case "Status":
                    {
                        _instance.Status = (string)value;
                        return;
                    }
                case "CommentDateUtc":
                    {
                        _instance.CommentDateUtc = (DateTime?)value;
                        return;
                    }
                case "CommentText":
                    {
                        _instance.CommentText = (string)value;
                        return;
                    }
                case "CommentedOn":
                    {
                        _instance.CommentedOn = (int?)value;
                        return;
                    }
                case "CommentedOnContainer":
                    {
                        _instance.CommentedOnContainer = (int?)value;
                        return;
                    }
                default:
                    {
                        throw new System.ArgumentOutOfRangeException(name);
                    }
            }
        }

        #endregion

        #region IObjectCreater Members

        public object CreateObject()
        {
            return new Orchard_Comments_CommentPartRecord();
        }

        public System.Collections.IList CreateObjectList()
        {
            return new System.Collections.Generic.List<Orchard_Comments_CommentPartRecord>();
        }

        #endregion
    }
}
